function  Lbt(el){
    this.el = document.querySelector(el)
    this.page= this.el.querySelectorAll("ul li")
    this.t=null
    this.num=1
    this.init()
}

Lbt.prototype.init = function(){
    this.autolb()
    this.overlb()
    this.outlb()
}

Lbt.prototype.overlb = function(){
    this.page.forEach((item,index)=>{
        item.onmouseover = ()=>{
            clearInterval(this.t)
            this.num = index + 1
            this.el.querySelector("img").src = `./imgs/img${this.num}.jpg`
            
            this.pagelb(this.num)
        }
    })
}

Lbt.prototype.outlb = function(){
    this.page.forEach(item => {
        item.onmouseout = ()=>{
            this.autolb()
        }
    })
}

Lbt.prototype.autolb = function(){
    this.t=setInterval(()=>{
        this.num++
        if(this.num > 6) this.num = 1
        this.el.querySelector("img").src = `./imgs/img${this.num}.jpg`
        this.pagelb(this.num)
    },1000)
}

Lbt.prototype.pagelb = function(num){
    this.el.querySelector("ul li.active").className = ""
    this.el.querySelector(`ul li:nth-of-type(${num})`).className = "active"
}